Skip to content

Instantly share code, notes, and snippets.

@atrinh0
atrinh0 / pluraliser_issues.swift
Last active June 1, 2024 20:38
Foundation Pluraliser Potential Issues
import SwiftUI
struct ContentView: View {
// sample of data was compiled using the following sources:
// https://birdgei.com/2011/08/30/list-of-100-irregular-plural-nouns-in-english/
// https://www.grammarly.com/blog/plural-nouns/
// https://www.thoughtco.com/irregular-plural-nouns-in-english-1692634
// https://www.ef.co.uk/english-resources/english-grammar/singular-and-plural-nouns/
// google
@brooksvb
brooksvb / Uptime-Kuma-Status-Page-Dark-Mode-High-Density-Tweaks.css
Last active June 1, 2024 20:36
These CSS tweaks are for higher density display for Uptime Kuma status pages in dark mode.
:root {
--min-item-width: 28ch;
--max-item-width: .5fr;
--grid-spacing: .25rem;
--item-padding: .25rem;
}
/* Let items expand on small screens */
@media (max-width: 600px) {
:root {
@feczkob
feczkob / autoinstall.md
Last active June 1, 2024 20:35
How to create USB that automatically installs Ubuntu Server 20.04

Steps to create the bootable USB

  1. Create folder
mkdir autoinstall-ISO
cd autoinstall-ISO
  1. Download ubuntu-autoinstall-generator
wget https://raw.githubusercontent.com/covertsh/ubuntu-autoinstall-generator/main/ubuntu-autoinstall-generator.sh
@hodgesmr
hodgesmr / hijacking_flask_routing_for_fun_and_profit.py
Last active June 1, 2024 20:33
Automatically register Flask routes with and without trailing slash. This way you avoid the 301 redirects and don't have to muddy up your blueprint with redundant rules.
"""Flask Blueprint sublcass that overrides `route`.
Automatically adds rules for endpoints with and without trailing slash.
"""
from flask import Blueprint, Flask
class BaseBlueprint(Blueprint):
"""The Flask Blueprint subclass."""
@andrewsg
andrewsg / gist:e6c2298a8a9241a40964
Last active June 1, 2024 20:32
ADA talk on programming languages (notes for first half of lecture)

Programming as communication

Programming is about communication. It's communication between a human and a computer, but it's also communication between humans and other humans, and between humans and their own future selves. To program, you have to fully elucidate your ideas and record them so that both computers and humans can understand you.

Languages facilitate this kind of communication. Programming languages have to be designed with the computer in mind, but they should also be designed to accommodate humans.

Of course, using comments and out-of-code documentation, you can and should communicate to humans independently from your code. But the program code also needs to be its own documentation, both because actual code and its documentation frequently disagree and because sometimes program code is itself the most elegant way to express an idea.

Languages themselves are software, and they're made up of specificiations and implementations. Ideally, the specifications d

@JakubOboza
JakubOboza / private-docker-regs-with-free-tiers.markdown
Created May 30, 2019 07:15
Private Docker registry with free tiers for Developers.

List of sites with free tier limits

  • Docker Hub - One private repo/image spot for free
  • Three Scale - Very generous free tier 50GB of space, 500 Pulls a month etc..
  • Canister - 20 private repos with almost no limits on free tier
  • Code Fresh - Free tier for developers

Setup your own private registry

@NSG650
NSG650 / WindowFocusLogger.c
Last active June 1, 2024 20:27
Logs which processes have received window focus
#include <stdio.h>
#include <Windows.h>
VOID CALLBACK WinEventProcHook(HWINEVENTHOOK hWinEventHook, DWORD event, HWND hwnd,
LONG idObject, LONG idChild, DWORD idEventThread, DWORD dwmsEventTime) {
DWORD ProcessId = 0;
if (GetWindowThreadProcessId(hwnd, &ProcessId) != 0) {
HANDLE ProcessHandle = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, ProcessId);
if (ProcessHandle != (HANDLE)(-1)) {
char buffer[MAX_PATH] = {0};
@Hyedryn
Hyedryn / AMI_BIOS_SHA256.md
Last active June 1, 2024 20:27
Recovering the BIOS password from an Asus VivoBook (AMI UEFI)

Recovering the BIOS Password from an Asus VivoBook (AMI UEFI)

This tutorial provides a step-by-step guide to recover the BIOS password from an Asus VivoBook using a memory dump.

Prerequisites

  1. Memory Dump: Obtain the memory dump of the BIOS using either a software method (as shown in the following writeup or a hardware programmer.
  2. Hashcat: Ensure you have Hashcat installed for brute-forcing the password.

Obtaining the Memory Dump

@AlexKobachiJP
AlexKobachiJP / XcodeCommand
Last active June 1, 2024 20:26
Sort file and package references in an Xcode project.
// Copyright © 2023 Alex Kovács. All rights reserved.
import ArgumentParser
import Foundation
import PathKit
import XcodeProj
// See below for `MainCommand` skeleton.
extension MainCommand {
struct XcodeCommand: ParsableCommand {